<?php

include"conn.php";
$name=$_POST['name']; 
$sex=$_POST['sex'];
$sql="insert into  tb_users(name,sex) value('$name',$sex)";
$rs=$mylink->query($sql);//$rs如果成功，rs为真   如果失败   rs为假
 if ($rs)

    {
        echo "<script language='javascript' type='text/javascript'>";        
        echo "window.location.href='index.php'";
        echo "</script>";
    }
 else 
    {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('添加用户失败！');";
        echo "window.location.href='index.php'";
        echo "</script>";
    }

